package com.cuit.service.impl;

import com.cuit.dao.AdminDao;
import com.cuit.doamin.Admin;
import com.cuit.doamin.User;
import com.cuit.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("adminService")
public class AdminServiceImpl implements AdminService {

    @Autowired
    private AdminDao adminDao;

    @Override
    public List<Admin> findAll() {
        System.out.println("业务层查询管理员成功。。。。。");
        return adminDao.findAll();
    }

    @Override
    public User findByUname(User user) {
        return adminDao.findByUname(user);
    }

    @Override
    public Admin findByAname(Admin admin) {
        return adminDao.findByAname(admin);
    }

    /**
     * 修改密码
     *
     * @return
     */
    @Override
    public int updatePwd(String name, String pwd) {
        return adminDao.updatePwd(name, pwd);
    }

}
